<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <script type="text/javascript">
var baseUrl = location.href.split('/').slice(0, -1).join('/');
function createBookmarklet(type) {
  var url = document.getElementById(type+'Url').value;
  var filename = url.split('/').pop();
  var query = 'url='+encodeURIComponent(url) + '&type='+type;
  var scriptStr = "javascript:(function(d,u,s){s=d.createElement('script');s.type='text/javascript';s.src=u;d.body.appendChild(s)})(document,'"+baseUrl+"/js/gfcjack.js#"+query+"')";
  document.getElementById('result').innerHTML = '<a href="'+scriptStr+'">gfcjack ('+filename+')</a>';
}
window.onload = function() {
  document.getElementById('scriptUrl').value = baseUrl + '/js/opensocial-test.js';
  document.getElementById('gadgetUrl').value = 'http://devlab.agektmr.com/OpenSocial/FriendConnect/FriendIntroducer.xml'
}
    </script>
	</head>
	<body>
    <h1>gfc-jack bookmarklet generator</h1>
    opensocial gadget url : <input id="gadgetUrl" type="text" value="" size="100" />
    <input type="button" value="create" onclick="javascript:createBookmarklet('gadget')" />
    <br/>
    opensocial script url : <input id="scriptUrl" type="text" value="" size="100" />
    <input type="button" value="create" onclick="javascript:createBookmarklet('script')" />
    <br/>
    <div id="result"></div>
	</body>
</html>

